/*
  学习目标：指定详细的返回值类型
*/

// 返回值类型由T组合自定义
type SetNameFn = <T>(aa: T) => { name: T };

const setNameFn: SetNameFn = (name) => ({ name: name });
const obj1 = setNameFn('123'); // {name: string}
const obj2 = setNameFn(123); // {name: number}
const obj3 = setNameFn(true); // {name: boolean}
const obj4 = setNameFn({ age: 123 }); // {name: {age: number} }
